const express= require("express");
const body= require("body-parser");
const multer= require("multer");


//1.监听的端口
let server =express()
server.listen(8080)
//注册中间件
//为普通模式
server.use(body.urlencoded({extended: false}));

let multerObj=multer({dest: './upload/'});
server.use(multerObj.any());

server.post("/login",(req,res)=>{
  console.log(req.body)
  console.log(req.files)
  res.send("OK");
})


//静态文件
server.use(express.static("./webapps/"));
